<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>

                <h1 class="span8">
                    <i class='icon-bullhorn'></i>
                    <span>CATEGORY</span>
                </h1>

                <div class="span4 text-right">
                    <a href="<?= URL::to('banner/admin/create/'); ?>" class="btn btn-large btn-inverse">Create New</a>
                </div>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class='row-fluid'>
        <div class="span12 box bordered-box blue-border" style="margin-bottom:0;">
            <div class="box-header blue-background">
                <div class="title">List of Category</div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>
            <div class="box-content box-no-padding">
                <div class="responsive-table">
                    <div class="scrollable-area">
                        <table class="table" style="margin-bottom:0;">
                            <?php if ($banners) { ?>
                                <thead>
                                <tr>
                                    <th>
                                        Banner Title
                                    </th>
									<th>
									View Page
									</th>
                                    <th>
                                        Clicks
                                    </th>

                                    <th>
                                        Impressions
                                    </th>

                                    <th>
                                        End Date
                                    </th>


                                    <th><span class="pull-right"> Action</span></th>
                                </tr>
                                </thead>
                                <tbody>

                                <?php foreach ($banners as $banners): ?>
                                    <tr>

                                        <td><?= Str::limit($banners->title, 50); ?>

                                            <a data-toggle="lightbox" href="#banner-<?=$banners->id;?>">
                                                <i class='icon-camera'></i>
                                            </a>
                                            <div id="banner-<?=$banners->id;?>" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
                                                <div class='lightbox-content'>
                                                    <img src="<?= URL::base().'/storage/uploads/banners/'.$banners->file ;?>">
                                                    <div class="lightbox-caption"><p><?= $banners->title;?></p></div>
                                                </div>
                                            </div>



                                        </td>
                                        <td>
                                        <?php if($banners->page == "0") echo "All";?>
                                        <?php if($banners->page == "1") echo "Index";?>
                                        <?php if($banners->page == "2") echo "Inner";?>
                                        </td>
                                        <td><?= $banners->clicks; ?>/<?= $banners->max_clicks; ?></td>
                                        <td><?= $banners->impressions; ?>/<?= $banners->max_impressions; ?></td>
                                        <td><?= $banners->to_date; ?></td>
                                        <td>
                                            <div class="text-right">

                                                <a class="btn btn-success btn-mini"
                                                   href="<?= URL::to("banner/admin/home/edit/$banners->id"); ?>"
                                                   title="Edit">
                                                    <i class="icon-edit"></i>
                                                </a>
                                                <a class="btn btn-danger btn-mini"
                                                   href="<?= URL::to("banner/admin/home/delete/$banners->id/$banners->file"); ?>"
                                                   title="Delete"
                                                    <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                                    <i class="icon-remove"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>

                                <?php endforeach; ?>


                                </tbody>
                            <?php } else { ?>
                                <div class="alert alert-danger">No data found..</div>
                            <?php } ?>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- END OF CONTENT -->
</div>

<!-- Modal -->
<div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" >
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"></span><span class="sr-only">X</span></button>
                <h4 class="modal-title" id="myModalLabel">Image preview</h4>
            </div>
            <div class="modal-body" >
                <img src="" id="imagepreview">
            </div>
        </div>
    </div>
</div>

